package com.bloveoa.zkkd.util;

import org.web3j.protocol.Web3j;
import org.web3j.protocol.http.HttpService;

/**
 * Created by yujunlong on 2018/4/2.
 */

public class Web3JClient {
    private Web3JClient(){}
    private volatile static Web3j web3j;
    public final static String ROPSTEN_URL = "https://ropsten.infura.io";
    public final static String MAIN_URL = "https://mainnet.infura.io";
    public final static String ETH_URL = MAIN_URL;

    public final static String LLJK_URL = "http://59.111.94.118:1777";

    public static Web3j getWeb3j(){
        if(web3j==null){
            synchronized (Web3JClient.class){
                if(web3j==null){
                    web3j = Web3j.build(new HttpService(MAIN_URL));
                }
            }
        }
        return web3j;
    }

}
